package eval.exceptions;



import eval.host.Host;
import eval.host.IHostManager;

/**
 * This exception will be thrown when there is an attempt to close host
 * which is not empty.
 * 
 * @author Amit Peled   <amit.kapina@gmail.com>
 * @author Igal Kaufman <igal.kaufman@gmail.com>
 */
public class CloseHostNotEmptytException extends RuntimeException {

	private static final long serialVersionUID = 1L;

	public CloseHostNotEmptytException(Host host,IHostManager hm) {
		super();
		if(host.getCurrentCpuLoad()>0)
			System.out.println("try to close host: "+host.getHostId()+" with load: "+host.getCurrentCpuLoad());
		if( host.getCurrentMemLoad()>0)
			System.out.println("try to close host: "+host.getHostId()+" with mem: "+host.getCurrentMemLoad());
		if(!hm.getVmsAtHost(host).isEmpty())
			System.out.println("try to close host: "+host.getHostId()+" with : "+hm.getVmsAtHost(host).size()+" vm on him");

	}

}